package org.example.ipersistent.sqlSession;

import org.example.ipersistent.executor.SimpleExecutor;
import org.example.ipersistent.pojo.Configuration;

public class DefaultSqlSessionFactory implements SqlSessionFactory {
  private Configuration configuration;

  public DefaultSqlSessionFactory(Configuration configuration){
    this.configuration = configuration;
  }

  @Override
  public SqlSession openSession(String namespace) {
    SimpleExecutor executor = new SimpleExecutor();
    return new DefaultSqlSession(configuration,executor,namespace);
  }
}
